// stores/counter.js
import { defineStore } from 'pinia'

interface UserInfo {
    name: string
    age: number
}

export const useStore = defineStore('useStore', {
    state: () => {
        return { username: 'cjh', age: 0, userList: [] as UserInfo[] }
    },
    // 也可以这样定义
    // state: () => ({ count: 0 })
    actions: {
        increment() {
            this.age++
        },
    },
})
